﻿using RayDen.Library.Entity.Interface;
using RayDen.Library.Entity.Renderer;

namespace RayDen.RayEngine
{
    public interface IEngineContext
    {
        QualitySettingsInfo QualitySettings { get; }
        OutputSettingsInfo OutputSettings { get; }
    }

    public class EngineContextBase : IEngineContext
    {
        public QualitySettingsInfo QualitySettings { get; private set; }
        public OutputSettingsInfo OutputSettings { get; private set; }

        public long TotalSamplesCount
        {
            get { return QualitySettings.SamplesPerPixel*OutputSettings.Width*OutputSettings.Height; }
        }

        public EngineContextBase()
        {
            this.QualitySettings = new QualitySettingsInfo();
            this.OutputSettings = new OutputSettingsInfo();
        }

        public EngineContextBase(IParameterBag parameterBag)
        {
            this.QualitySettings = new QualitySettingsInfo(parameterBag);
            this.OutputSettings = new OutputSettingsInfo(parameterBag);
        }
    }
}